package com.youkeyi.ddy.cloud.common.enums;

/**
 * @author zty_Love
 * @date 2024/06/18.
 * @time 18:16
 **/
public enum InterviewStatusEnum {
    //面试状态(0 未定义 1 预约 2 完成 3 缺席 4 改期 5 取消)

    UNDEFINED(0, "未定义"),
    APPOINTMENT(1, "预约"),
    COMPLETION(2, "完成"),
    ABSENCE(3, "缺席"),
    RESCHEDULING(4, "改期"),
    CANCELLATION(5, "取消");

    private Integer code;
    private String desc;

    InterviewStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getDesc() {
        return this.desc;
    }

    public static InterviewStatusEnum fromCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (InterviewStatusEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
    public static InterviewStatusEnum fromDesc(String desc) {
        for (InterviewStatusEnum type : values()) {
            if (type.getDesc().equals(desc)) {
                return type;
            }
        }
        return null;
    }
}
